package com.hsteach.service.todothings;

import java.util.List;

import com.hsteach.dao.domain.todothings.Todothings;
import com.hsteach.dao.mapper.todothings.TodothingsMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.hsteach.common.utils.DateUtils;

/**
 * 待办Service业务层处理
 * 
 * @author fanxquer
 * @date 2023-12-22
 */
@Service
public class TodothingsService
{
    @Autowired
    private TodothingsMapper todothingsMapper;

    /**
     * 查询待办
     * 
     * @param id 待办主键
     * @return 待办
     */
    public Todothings selectTodothingsById(Long id)
    {
        return todothingsMapper.selectTodothingsById(id);
    }

    /**
     * 查询待办列表
     * 
     * @param todothings 待办
     * @return 待办
     */
    public List<Todothings> selectTodothingsList(Todothings todothings)
    {
        return todothingsMapper.selectTodothingsList(todothings);
    }

    /**
     * 查询待办列表
     *
     * @param todothings 待办
     * @return 待办
     */
    public List<Todothings> getTodothingsList(Todothings todothings)
    {
        return todothingsMapper.getTodothingsList(todothings);
    }

    /**
     * 新增待办
     * 
     * @param todothings 待办
     * @return 结果
     */
    public int insertTodothings(Todothings todothings)
    {
        todothings.setCreateTime(DateUtils.getNowDate());
        return todothingsMapper.insertTodothings(todothings);
    }

    /**
     * 修改待办
     * 
     * @param todothings 待办
     * @return 结果
     */
    public int updateTodothings(Todothings todothings)
    {
        todothings.setUpdateTime(DateUtils.getNowDate());
        return todothingsMapper.updateTodothings(todothings);
    }

}
